/* $Header: set.h,v 2.2 01/10/02 10:30:40 przybyls Exp $ */

/***********************************************************************/
/* INCLUDE FILE NAME:   set.h                                          */
/* ==================                                                  */
/*                                                                     */
/* Author: Tom                                                         */
/*                                                                     */
/* COMMENT: Macros for set functions and data comm to supply(or switch)*/
/*  pointer from Active Workfile or Check Area depending on task       */
/*  and data comm switch.                                              */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef SET_H
#define SET_H

#include <task_pub.h>     /* get TASK_Current() & TaskID definitions */
#include <tasks.h>        /* get MIO_Cmd_Task_ID                     */

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/*****************************/
/*   TYPEDEFS                */
/*****************************/


/*****************************/
/*   EXTERNALS               */
/*****************************/

extern BIT8    DC_Use_Check_Area;


/*****************************/
/*   MACROS                  */
/*****************************/

#define USE_CHECK_AREA()     DC_Use_Check_Area = TRUE

#define USE_ACTIVE_WKFILE()  DC_Use_Check_Area = FALSE

/* REVISIT - there is no check area anymore */
#if 0
#define WORKFILE                                          \
         (                                                \
           ((TASK_Current() == MIO_Cmd_Task_ID) &&        \
            (DC_Use_Check_Area)                    ) ?    \
               &Stored_Wkfile[0]  :  &Active_Wkfile       \
         )
#else
#define WORKFILE (&Active_Wkfile)
#endif

#define ACTIVE_WORKFILE ( ( TASK_Current() != MIO_Cmd_Task_ID ) ||  \
                         ( DC_Use_Check_Area == FALSE ) )
#endif
